home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Tele / Q-S / S-Tool 1.2.sit / TimeStamp.c < prev    next >
Encoding:
Text File  |  1994-04-15  |  595 b   |  40 lines  |  [TEXT/KAHL]

  1. // TimeStamp.c
  2. // 
  3. // Example device parser
  4. //
  5. // PARS resource for S-Tool
  6. // creates a timestamp for readings by recording the time a value came through
  7. //
  8.  
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <SetUpA4.h>
  12.  
  13. main(char *inString, char *outString)    // standard arguments for 
  14.                                         // S-Tool main
  15. {
  16.     double             num;
  17.     DateTimeRec        now;
  18.     
  19.     RememberA0();
  20.     SetUpA4();
  21.     
  22.     sscanf(inString, "%lf", &num);
  23.  
  24.     GetTime(&now);
  25.  
  26. /* output:
  27.  
  28. hour:minute.second    (tab)    number
  29.  
  30. eg:
  31.  
  32. 15:27.15    3.752
  33.  
  34. */
  35.  
  36.     sprintf(outString, "%d:%d.%d\t%.3lf\n", now.hour, now.minute, now.second, num);
  37.  
  38.     RestoreA4();
  39. }
  40.